Method and System to Allow Printing Compression of Documents

ABSTRACT

A print compression method and system reduces the amount of space required to print a document such that less paper is used during the printing of a document. A user defines criteria, which is used to perform document compression. However, the document compression only applies to the form of document being printed. This compression does not affect the document being edited.

FIELD OF THE INVENTION

The present invention relates to a method and system for printing adocument on a page and in particular to a method and system thatautomatically compresses the amount of information that is to be printedon a page in order to reduce the amount of paper needed to print theinformation.

BACKGROUND OF THE INVENTION

A computer printer is a computer peripheral device that produces a hardcopy (permanent human-readable text and/or graphics, usually on paper)from data stored in a computer connected to it. FIG. 1 illustrates atypical computer and printing system. As shown, the personal computer 2has a display screen 5, a keyboard 6, a coordinate input device (mouse)7, and a controller body 8. The controller body 8 is connected to thelaser printer 3 by a connecting cable 9. Therefore, various image printdata generated by the personal computer 2 can be transmitted to thelaser printer 3.

The data received by the printer may be: 1) a string of characters, 2) abitmapped image, or 3) a vector image. The string of characters, incomputing terms, plain text is textual material that is usually in anunformatted form. Plain text is represented as files in ASCII text orhuman-readable form. Each character has a binary code representation.For example, the binary code for a carriage return (CR) is 0000 1101.The binary code for an end text is 0000 1100. The binary code for a nullcharacter is 0000 0000.

When a print instruction occurs in the personal computer, the printerdriver is started to the conversion of the image data to binary formatand to compress the binary data. Then, print data, includinglanguage-expressing data by a page-description language, controlcommands, and the compressed image data are transmitted to the laserprinter 3.

A page printer such as a laser printer is capable of performinghigh-speed printing. Laser printers receive print data, such as textdata and image data, from an external device, such as a host computer ora personal computer, and stores the print data as packet data, whichincludes print information and code data for characters and symbols andprint position information for image data. The packet data is developedinto bit image data with a printable format and stored in a print imagebuffer. The developed bit image data for one dot line corresponding to asingle raster scan, is sequentially retrieved from the print imagebuffer and outputted to a print mechanism. The print mechanism thenprints the text or image on a print medium such as a sheet of paper.

Much printing that occurs is informal printing in that the document isprinted out to review and edit. After the completion of the editingprocess, the user prints a final version of the document. Many documentshave data that is arranged in various ways as desired by the creator ofthe document. As part of theses arrangements, documents can contain manyblank spaces or blank sections. In addition, the font size of thecharacters will necessitate the need for additional pages to contain thecontents of the document. Many of these pages are printed with variousamounts of information on them. In some cases, the contents of multiplepages could easily fit onto one page. The printing of document pagescontaining little content can result in a needless use of paper. Toaddress the problems of wasted paper and time-consuming prints, a manualstep prior to printing the document would be to take out the spaces andreduce the size of large fonts. There is no automated algorithm that canpreprocess a document prior to printout that will quickly and reliablyimprove the efficiency of printout. Further, the manual process resultsin a modification of the actual document that would require changing thedocument back to the version prior to the compression for printing.

Currently, there is feature in some word processors, which allows a userto identify a selection of text and then also specify the desired numberof pages that text should fit in. Taking that information, the wordprocessor then incrementally shaves off point values in the linespacing, font size and margin sizes until it can fit the text into thespecified number of pages. However, this feature has limitations in thatit only allows very small incremental changes to the printed document.Further, the changes allowed by this function are also forced to beproportional and has a gating factor in the function to only allow arelatively small amount of change to the document before it will fail.The design goal of this feature is to maintain the same exact look andfeel of the previous state and all elements of text, keming, margin,size, line spacing are all changes in proportion to each other. Thiscurrent feature would not accomplish nearly as much space savings asdesired for many applications, but could be only used for documentswhich must keep the same formatting when printed.

There have been other efforts to reduce or compress data during theprinting process. U.S. Pat. No. 5,771,340 (Nakazato, et al.) In themethod printing data transmitted from a host computer is stored in areceiving buffer. An editorial unit receives the printing data in thereceiving buffer in each one line and writes into a page buffer aftercompressed. The editorial unit compresses the printing data with pluraltypes of compression techniques and computes compression rates for eachline of data. A compression technique to be applied is determined inaccordance with the compression rates. The printing data of each line upuntil those of the preset line X are compressed by the determinedcompression technique. A determination of the compression technique isrepeated in every completion of the printing data processing for the Xlines. An expansion unit reads out the printing data in the page bufferand deploys them into a band buffer as a raster data. An engine unitperforms printing in accordance with the raster data in the band buffer.

U.S. Pat. No. 5,604,846 (Kadota) In this method in order to improveusage efficiency of a RAM provided in a video controller of a laserprinter and to prevent occurrence of print overrun errors, a packetdata, which contains character/symbol code data and print positioninformation thereof, is developed into a printable format data on a bandbasis, which is then compressed and stored in an image data bufferprovided in the RAM. The compressed image data is retrieved and decodedto restore the original printable format data. The latter data is storedin a print buffer and then sent to the print mechanism for printing.When the image data buffer does not have sufficient memory space forstoring subsequent one band's worth of the packet data in compressedform, the data which has already been processed is erased to secure freearea of the image data buffer. Alternatively, resolution of theprintable format data stored in the image data buffer in compressed formis reduced to secure free memory space in the image data buffer.

U.S. Pat. No. 6,166,824 (Kadota) This invention describes a print dataprocessing apparatus and an input data generating apparatus, in whichimage data of an original image generated by a personal computer isconverted to binary in a selected binary mode. The designation number Dnof the selected binary mode is transmitted with the binary image data toa laser printer. In the laser printer, a data thinning mode-designatingnumber Pn corresponding to the designation number Dn received is set. Ifthe capacity of a development buffer is insufficient, themode-designating number Pn is read and identified. If Pn=“X1”, thinningis performed in a first data thinning mode. If Pn=“Y2”, thinning isperformed in a second data thinning mode. If Pn=“Z3”, thinning isperformed in a third data thinning mode. Therefore, if the capacity of astorage device for storing dot image data to be supplied for printingbecomes insufficient, dot image data can be reduced in size in anoptimal irreversible compressing device selected in accordance with thetype of original image.

Although these techniques address the compression of information inregard to the printing process, these approaches focus on the storing ofinformation in the printer prior to the actual printing operation. Thesesolutions do not address the problems with printing documents such thatthe amount of paper needed for printing is optimized.

With regard to optimizing the paper on which a document is printed, thedrawbacks of the known solutions are that they require a manual step fora person to physically modify a document prior to printing. This takesvaluable time and results in the original document being modified.Consider that a person modifies a document to reduce the amount of paperthe printout will consume. After printing, the person must either undothe changes or save the new compressed-for-printing document under adifferent name.

There remains a need for a method and system that provides dynamicanalysis and compression of the contents and arrangement of a documentbefore the printer prints the document. This analysis and compressionshould also occur without the need for manual steps and without the needto re-save the document.

SUMMARY OF THE INVENTION

It is an objective of the present invention to provide a method andsystem that optimizes the amount of paper needed to print a document.

It is a second objective of the present invention to provide a methodand system that automatically reduces the amount of print space neededto print out a document.

It is a third objective of the present invention to provide a methodthat reformats a document during the printing process such that thedocument requires less material for printing.

It is a fourth objective of the present invention to provide a methodthat can automatically modify the font size of characters in a documentin order to reduce the amount of space needed to print that document.

The core idea of the invention surrounds a dynamic preprinting processto be applied to a document such that when the document is printed, itdoes not need to keep the same formatting as the source document.Consider the example of a person printing a contract for delivery to acustomer, the person is very concerned about format and size ofcharacters. The printed document must match exactly the document createdin the word processor. In contrast, consider the example of printingforms or reports as a draft copy or for personal consumption, the personnow may not care about such formatting. By utilizing this method ofprintout compression, the person is able to print out such draft viewswith less paper and in less time.

In the method of the invention, the user can open a document via someword processing program. The user can then select the print option forprinting the document. At this point, the print page could display aprinter compression option in the form of an icon. When the user pressesthis option, the user would then supply print criteria. At this point,the method would search the document and perform reformatting tasks asdefined by the print criteria. For example, there may a rule that says:replace [space] [space] with [space]. This operation would replace adouble space with a single space. Other criteria could be to reduce thenumber of carriage returns or reduce the line spacing from double spaceto single space. At the completion of this reformatting process, the newdocument is printed. The intent is that the reductions in space willreduce the amount of paper needed to print the document.

DESCRIPTION OF THE DRAWINGS

FIG. 1. illustrates a conventional configuration of a computer andprinter system.

FIG. 2. illustrates a print display screen having various options forprinting a document.

FIG. 3. illustrates a print compression display page having variousprint compression options.

FIG. 4. is a general flow diagram of the steps in the implementation ofthe present invention.

FIG. 5. is a flow diagram of the interaction between a user and themethod of the present invention.

FIG. 6. is a detailed flow diagram of the steps in the implementation ofthe present invention.

FIG. 7. is flow diagram of the implementation of specific reformattingcriteria in accordance with present invention.

DETAILED DESCRIPTION OF THE INVENTION

The present invention provides automated method to reduce the amount ofpaper required to print certain documents. In application, the method ofthe invention scans through a document and modifies the document byremoving unnecessary space (white space) on the document in accordanceto predefined criteria for the document. The modified document is thenprinted using less paper. The following example shows how the inventioncan be applied. A person wants to print a 30-page document containing ascripting language source code listing. Upon printing the 30-pagedocument, it is apparent that most of the white space could beeliminated. Additionally the comments could also be removed. Theinvention adds the preprinting functionality to reduce this amount ofwhite space such that the entire printout is now only 10 pages. Toaccess this function, a person would be presented with options duringthe printout function to allow such a compressed printout. Configurationchanges to the document such including “Use minimum amount of paper aspossible” or “Remove unneeded blank pages” or “Remove all embedded whitespace,” etcetera, can be applied prior to printing.

FIG. 2. illustrates a print display screen having various options forprinting a document. This display is a typical print option screen forprinting a document from a word processor. As shown, the screen containsfields associated with printing a document, which includes the name ofthe printer, the number pages, the number of copies, the cancel icon andthe print/OK icon to initiate the printing process. Some of the iconstake the user to additional screens where the user can further definehow to print the document. One such icon is the Properties icon 25. Inthe present invention, the print page will contain additional PrintCompression icon 27. This icon enables the user to define the criteriafor a print compression of the identified document that the user desiresto print.

FIG. 3. illustrates a page in which the user can define specific printcompression criteria. Upon the user clicking the Printer Compressionicon 27, the print compression display shown in FIG. 3. could appear onthe user's screen. As shown, this screen has several print compressionparameters that a user can select. The user could click the box next toany criteria the user desires. For example, if the user clicked spaces,carriage returns, line concatenation and font size 12 point, the methodof the invention would use these criteria to print the document.Clicking these icons would enact routines that function according torules for each type of compression.

FIG. 4. is a general flow diagram of the steps in the implementation ofthe present invention. The first step 40 is to initialize the printingcompression option. This initialization occurs when the user clicks thePrinter Compression icon 27. As mentioned, once the user clicks thePrinter Compression icon, the printer compression display of FIG. 3.appears. At this point, the user can define the print compressionparameters in step 41. The user can return to the main print display andinitiate the printing process. During this process, step 42 retrievesthe identified document to be printed. Step 43 performs the reformattingof the document according to the defined print compression criteria.After the reformatting of the file to the compressed format, step 44prints the document in the compressed form.

FIG. 5. is a flow diagram of the interaction between a user and themethod of the present invention. In step 50, a user selects a printoption for a document in a conventional manner. The user then selectsthe print compression option from the print display in step 51. Theprint compression selection display of FIG. 3. gives the user manyoptions, which can include whether or not graphics needs to be printedand whether the typeface of all fonts should be reduced in size. Theuser defines the print compression criteria in step 52. The userinitiates the print compression option, step 53, by click the OK icon onthe printer compression display. In step 54, the method optionallyallows for the user to define logical group identifiers by specifying astart and end character key map. The key map may look similar to thefollowing:

Major Group Characters: Start =[End=]

Minor Group Characters: Start={End=}

This provides better printing compression techniques by allowing thealgorithm to analyze certain groups of characters. In a document of Javacode the {and} key characters would help keep logical groups of code onthe same compressed line. In a spreadsheet the keying characters may be“Item” and “Total” which will maintain the document's readability.

Step 55 applies a specific routine for compressing white space in thedocument. The routine first searches for white space (consecutive blankspaces) and applies a space compression rule such the below illustratedrule. For the spacing routine, the rule could be: TABLE-US-00001 Replacethis With this [space] [space] [space]

In step 56, the method removes multiple carriage returns andconcatenates lines, which are less than one-half page wide. For theCarriage return routine, the rule could be: TABLE-US-00002 Replace thisWith this <CR><CR><CR>

For the line concatenation routine, the rule could be: TABLE-US-00003Replace this With this <Less than ½ lin2><CR><characters><SPACE>

In step 57, the method reformats fonts to be readable on the paper sizespecified. This function involves, for example, changing a 24 pt. boldheader to a 12 pt normal non-bold text.

For the Font Size 12 routine, the rule could be: TABLE-US-00004 Replacethis With this 24 pt 12 pt.

In an example of the below listed document content, the algorithm(routine) first replaces all the multiple spaces with a single space.TABLE-US-00005 value value value value value value value value valuevalue value value value value value value value value value value valuevalue value value value value value value value value

As a result, the document then looks like this: TABLE-US-00006 valuevalue value value value value value value value value value value valuevalue value value value value value value value value value value

The algorithm then looks for carriage returns, which appear well beforethe end of the line. If the user has a document which contains [0040]value [0041] value [0042] value [0043] value [0044] value [0045] value[0046] value [0047] value [0048] value [0049] value

The invention analyzes these carriage return new lines, compressing themdown to single spaces. From a pre “amount of data” point of view, thenew line takes up the same storage space as any other character, but itobviously causes more paper to be wastes upon printout. Again, with thistreatment, the document then looks like: TABLE-US-00007 value valuevalue value value value value value value value value value value valuevalue value

Next, the algorithm looks at the sizes of characters in the document andreduces these fonts to the defined font (12 pt). If the font size isalready smaller, that font size would remain the same. In an alternateapproach if no font size is specified, the algorithm can look at thesizes of characters in the document to determine if the fonts can bereduced in size whilst still being readable. If the document contains:Hello, this is Chris Now we have some smaller text here, but all I careabout is that I can read it . . . blah . . . blah . . . blah . . . Theinvention analyzes the font sizes and type in the document and takesinto account the size of the paper that the document is to be printedon. Each font that can be reduced while still readable when printed onthe selected paper size is modified. Again, with this treatment, thedocument looks like:

-   -   Hello, this is Chris. Now we have some smaller text here, but        all I care about is that I can read it . . . blah . . . blah . .        . blah . . .

If there are no shorten lines, the line concatenation criteria would notapply in this particular document. Taking these three compressiontechniques into account, a script which looks like: TABLE-US-00008 while(1) {blah_blah echo (“Hello World!”) endblah_blah } Will end up lookinglike: while (1) {blah_blah echo (“Hello World!”) endblah blah}

In some applications, a user may only want to compress a portion of thedocument. FIG. 6. is a detailed flow diagram in which the userdesignates a portion of the document to compress during the printingprocess. In step 60, the print compression process option is implementedby receipt of a print compression command. As part of this step 60, themethod also receives information about the print compression criteria.The start marker identifying the beginning of the section to becompressed and the end marker identifying the end marker of the sectionare designed in as part of these criteria. After receipt of the printcompression criteria, step 61 retrieves the file of the document to beprinted. Step 62 identifies the start marker and end markers and movesto the location of the start marker. Step 63 retrieves and performs aprint compression criterion. This criterion is performed until thedetection of the end marker in step 64. Step 65 determines if there isanother print compression criterion to perform. If there is anothercriterion, the process moves to step 63 and repeats steps 63, 64 and 65for that criterion. If there are no more print compression criteria toperform, the method prints the reformatted document in step 66.

In addition to text material, many documents have graphics and picturesin the documents. To compress these documents, there has to be adetermination of the treatment of the pictures or graphics. Optionscould be to remove a picture from the printed document, relocate apicture to another location in the document or to reduce the size of apicture at its current document location.

FIG. 7. is flow diagram of the implementation of specific printcompression criteria considering documents that have pictures. Step 70is the initialization step and can include (for purpose of explanation)the steps of identifying the print compression criteria as described inFIG. 6. Step 71 compresses the blank spaces in the document. Step 72 cancompress the carriage returns in the document. At the completion of thedesignated print compression criteria, step 73 makes a determination ofwhether the document contains a picture. This determination may be basedon picture identifiers in the file. These identifiers may be inherent inthe file and may not require the user to specifically designate them. Ifthere are pictures, the determination is made in step 74 of whether toremove the picture(s), modify the picture size or relocate the picture.Relocation of the picture could be to place the pictures at the end ofthe document. The user can also designate if they want to print thepictures as part of the compressed document file. Step 75 performs thedefined criteria on the picture(s). Next, the document is printed incompressed format in step 76.

The advantages of the present invention provide an important featurethat will allow users to more efficiently print documents. Some of theadvantages over the known solutions are therefore: [0057] 1) The timetaken to print a document for draft or personal consumption is reduced;[0058] 2) The amount of paper needed to print the full document isreduced; [0059] 3) There is no manual step for a user to have to modifythe document prior to printing. The invention automates the processdynamically; 4) The amount of ink used to print the entire document isreduced. It is important to note that while the present invention hasbeen described in the context of a fully functioning data processingsystem, those skilled in the art will appreciate that the processes ofthe present invention are capable of being distributed in the form ofinstructions in a computer readable medium and a variety of other forms,regardless of the particular type of medium used to carry out thedistribution. Examples of computer readable media include media such asEPROM, ROM, tape, paper, floppy disc, hard disk drive, RAM, and CD-ROMsand transmission-type of media, such as digital and analogcommunications links.

1. A method of compressing a document format for printing withoutaffecting the original document format comprising the steps of:identifying defined print compression criteria; retrieving a copy of thedocument for printing; identifying one or more areas of the documentdesignated for print compression; reformatting the document byautomatically compressing the retrieved document by applying theidentified print compression criteria to the document file; and printingthe compressed document file.
 2. (canceled)
 3. (canceled)
 4. (canceled)5. (canceled)
 6. (canceled)
 7. (canceled)
 8. (canceled)
 9. (canceled)10. (canceled)
 11. (canceled)
 12. (canceled)
 13. (canceled) 14.(canceled)
 15. (canceled)
 16. (canceled)
 17. (canceled)
 18. (canceled)19. (canceled)
 20. (canceled)
 21. The method as described in claim 1wherein the identified print compression criteria could include thereduction of consecutive spaces the reduction of multiple consecutivecarriage returns and the reduction of font size of characters in thedocument file.
 22. The method as described in claim 1 further comprisingafter said document retrieving step, the step of identifying a startdocument marker and an end document marker the start and end documentmarkers designating the portion of the document for which printcompression is required.
 23. The method as described in claim 22 whereinthe start area marker and end area marker further comprise defaultmarkers which are the start of the document and end of the document whenno particular start area marker and no end area marker are identified.24. The method as described in claim 21 wherein said reformatting stepfurther comprises: scanning the document file; and identifyingconsecutive spaces in a line of characters; and reducing the number ofconsecutive spaces to one space.
 25. The method as described in claim 24further comprising after said step of reducing the number of consecutivespaces to one space the steps of: determining the lengths of consecutivelines; and combining consecutive lines when the combine lengths ofconsecutive lines are less than the length of a document line.
 26. Themethod as described in claim 24 further comprising after said step ofreducing the number of consecutive spaces to one space the steps of:determining the total length of consecutive lines; determining a pointof concatenating the length of the second line such that part of thesecond line is added to the first line such that the length of the firstline is increased to a length that does not exceed document margins;adding the second line to the first line up the point of concatenationof the second line; and repeating said determining total length ofconsecutive lines step, said determining concatenating point step andsaid adding lines step for consecutive lines.
 27. The method asdescribed in claim 26 wherein said steps in claim 26 are performed for adesignated portion of the document one such designation being aparagraph designation.
 28. The method as described in claim 21 whereinsaid reformatting step further comprises; scanning the document file;and identifying multiple consecutive carriage returns and reducing themultiple consecutive carriage returns to one carriage.
 29. The method asdescribed in claim 28 further comprising after said step of reducing thenumber of consecutive spaces to one space the steps of: determining thelengths of consecutive lines; and combining consecutive lines when thecombine lengths of consecutive lines are less than the length of adocument line.
 30. The method as described in claim 28 furthercomprising after said step of reducing the number of consecutive spacesto one space, the steps of: determining the total length of consecutivelines; determining a point of concatenating the length of the secondline such that part of the second line is added to the first line suchthat the length of the first line is increased to a length that does notexceed document margins; adding the second line to the first line up thepoint of concatenation of the second line; and repeating saiddetermining total length of consecutive lines step, said determiningconcatenating point step and said adding lines step for consecutivelines.
 31. The method as described in claim 21 wherein said reformattingstep further comprises: identifying character font sizes; modifying thefont size of characters according to an identified font size in theidentified document print criteria; determining the lengths ofconsecutive lines; and combining consecutive lines when the combinelengths of consecutive lines are less than the length of a documentmargins
 32. The method as described in claim 21 wherein saidreformatting step further comprises: identifying character font sizes;reducing font size of characters according to an identified font size inthe identified document print criteria; determining the total length ofconsecutive lines; determining a point of concatenating the length ofthe second line such that part of the second line is added to the firstline such that the length of the first line is increased to a lengththat does not exceed document margins; adding the second line to thefirst line up the point of concatenation of the second line; andrepeating said determining total length of consecutive lines step, saiddetermining concatenating point step and said adding lines step forconsecutive lines.
 33. The method as described in claim 1 wherein saidreformatting the document by automatically compressing the retrieveddocument by applying the identified print compression criteria to thedocument file further comprises the steps of: scanning the documentfile; identifying consecutive spaces in a line of characters andreducing the number of consecutive spaces to one space; identifyingcharacter font sizes and modifying the font size of characters accordingto an identified font size in the identified document print criteria;identifying multiple consecutive carriage returns and reducing themultiple consecutive carriage returns to one carriage; determining thelengths of consecutive lines; and combining consecutive lines when thecombine lengths of consecutive lines are less than the length of adocument margins
 34. A computer program product in a computer readablemedium for compressing a document format for printing without affectingthe original document format comprising: instructions identifyingdefined print compression criteria; instructions retrieving a copy ofthe document for printing; instructions identifying one or more areas ofthe document designated for print compression; instructions reformattingthe document by automatically compressing the retrieved document byapplying the identified print compression criteria to the document file;and instructions printing the compressed document file.
 35. Thecomputing program product as described in claim 34 wherein saidreformatting instructions further comprise: instructions scanning thedocument file; instructions identifying consecutive spaces in a line ofcharacters; and instructions reducing the number of consecutive spacesto one space.
 36. The computing program product as described in claim 34wherein said reformatting instructions further comprise; instructionsscanning the document file; and instructions identifying multipleconsecutive carriage returns and reducing the multiple consecutivecarriage returns to one carriage.
 37. The computing program product asdescribed in claim 34 wherein said reformatting instructions furthercomprise: instructions identifying character font sizes; instructionsfor modifying the font size of characters according to an identifiedfont size in the identified document print criteria; instructionsdetermining the lengths of consecutive lines; and instructions combiningconsecutive lines when the combine lengths of consecutive lines is lessthan the length of a document margins
 38. The computer program productas described in claim 34 wherein said instructions for reformatting thedocument by automatically compressing the retrieved document by applyingthe identified print compression criteria to the document file furthercomprise: instructions scanning the document file; instructions foridentifying consecutive spaces in a line of characters and reducing thenumber of consecutive spaces to one space; instructions identifyingcharacter font sizes and modifying the font size of characters accordingto an identified font size in the identified document print criteria;instructions identifying multiple consecutive carriage returns andreducing the multiple consecutive carriage returns to one carriage;instructions determining the lengths of consecutive lines; andinstructions for combining consecutive lines when the combine lengths ofconsecutive lines is less than the length of a document margins
 39. Asystem for compressing a document format for printing without affectingthe original document format comprising: a software module foridentifying print compression criteria; and a software module forreformatting the document by automatically compressing the retrieveddocument by applying the identified print compression criteria to thedocument file, the reformatting software module further comprising: asoftware module for identifying consecutive spaces in a line ofcharacters and reducing the number of consecutive spaces to one space, asoftware module for identifying character font sizes and modifying thefont size of characters according to an identified font size in theidentified document print criteria; a software module for identifyingmultiple consecutive carriage returns and reducing the multipleconsecutive carriage returns to one carriage; and a software module forcombining consecutive lines when the combine lengths of consecutivelines is less than the length of a document margin.